﻿@using PagedList;
@using PagedList.Mvc;
@model IPagedList<Admin.Models.TblHotel>

@{
    ViewBag.Title = "Index";
}
<p>
    @Html.ActionLink(Admin.Common.GetResourceText.GetValueResource("Add_new_hotel"), "Create")
</p>
<table class="table table-striped table-bordered bootstrap-datatable datatable dataTable">
    <thead>
    <tr role="row">
        <th>
            @Admin.Common.GetResourceText.GetValueResource("HotelName")
        </th>
        <th>
           @Admin.Common.GetResourceText.GetValueResource("StarRating")
        </th>
        <th>
            @Admin.Common.GetResourceText.GetValueResource("NumberOfRooms")
        </th>
        <th>
            @Admin.Common.GetResourceText.GetValueResource("CountryName")
        </th>
        <th>
             @Admin.Common.GetResourceText.GetValueResource("ProvinceID")/
             @Admin.Common.GetResourceText.GetValueResource("CityName")
        </th>

        <th>
            @Admin.Common.GetResourceText.GetValueResource("StreetAddress")
        </th>
        <th>
          @Admin.Common.GetResourceText.GetValueResource("MainPhone")
        </th>
         <th>
            @Admin.Common.GetResourceText.GetValueResource("Representative")
        </th>
        <th>
            @Admin.Common.GetResourceText.GetValueResource("IsActive")
        </th>
        <th></th>
    </tr>
        </thead>
@foreach (var item in Model) {
    <tr>  
        <td>
          
             @Html.ActionLink(item.HotelName, "Edit", new { id = item.HotelID })
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.StarRating)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.NumberOfRooms)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.TblCountry.CountryName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.TblCity.CityName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.StreetAddress)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.MainPhone)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.TblUserProfile.UserName)
        </td>
        <td>
            
             @if ((bool)item.IsActive)
            {
                 @Html.CheckBox("false",true,new { disabled = "disabled" })
            }
            else
            {
                 @Html.CheckBox("false",false,new { disabled = "disabled" })
            }
        </td>
        <td>
            @Html.ActionLink("Delete", "Delete", new { id=item.HotelID},  new {@class="btn btn-danger" })
        </td>
    </tr>
}                                                                 

</table>
@Html.PagedListPager(Model, PageSize => Url.Action("Index", new { PageSize }), new PagedListRenderOptions() { 
    Display = PagedListDisplayMode.IfNeeded})

@Html.Partial("FileManager");
